home *** CD-ROM | disk | FTP | other *** search
- partyline.boot {
- if (($chkflag($gettok($1,2,46),*,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [reason]
- return 0
- }
- if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
- sockwrite -n $1 Can't boot the owner.
- return 0
- }
- if ($sock($addtok(partyline,$3,46)) != $null) {
- pl.bc $addtok(partyline,$3,46) *** $gettok($1,2,46) booted $3 from the $iif($pl.var($3,channel),channel,party line) $+ $iif($4,:,.) $4-
- sockwrite -n $addtok(partyline,$3,46) -=- poof -=-
- sockwrite -n $addtok(partyline,$3,46) You've been booted from the $iif($pl.var($3,channel),channel,party line) by $gettok($1,2,46) $+ $iif($4,:,.) $4-
- if ($sock($addtok(telnet,$3,46))) sockclose $addtok(partyline,$3,46)
- else {
- sockwrite -n $addtok(partyline,$3,46) Returning to interface menu...
- sockrename $addtok(partyline,$3,46) $addtok(telnet,$3,46)
- tel.login $addtok(telnet,$3,46) .
- }
- pl.clr $3
- return 1
- }
- sockwrite -n $1 Who? No such person on the party line.
- return 0
- }
- partyline.+host {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> <newhostmask>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if ($findtok($hstmask($3),$4,1,32)) {
- sockwrite -n $1 That hostmask is already there.
- return 0
- }
- if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
- sockwrite -n $1 Can't add hostmasks to the owner.
- return 0
- }
- .auser 40 $4
- .save -ru users.mrc
- writeini -n users.ini $3 hostmask $hstmask($3) $4
- writeini -n users.ini Users $4 $3
- colupdt3 $4
- sockwrite -n $1 Added ' $+ $4 $+ ' to $3
- return 1
- }
- partyline.-host {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> <hostmask>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
- sockwrite -n $1 Can't remove hostmasks from the owner.
- return 0
- }
- if (($findtok($hstmask($3),$4,1,32) == $null) || ($hstmask($3) == $4)) {
- sockwrite -n $1 Failed.
- return 0
- }
- .ruser 40 $4
- .save -ru users.mrc
- remini users.ini Users $4
- writeini -n users.ini $3 hostmask $remtok($hstmask($3),$4,1,32)
- colupdt3 $4
- sockwrite -n $1 Removed ' $+ $4 $+ ' from $3
- return 1
- }
- partyline.chattr {
- if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [flags [#channel]]
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user!
- return 0
- }
- if ($5) {
- if ($findtok($usrchans($3),$5,1,44)) set %tmp.partyline.chattr - $+ $cflags($3,$5)
- else {
- writeini -n users.ini $3 channels $addtok($usrchans($3),$5,44)
- set %tmp.partyline.chattr -
- }
- }
- else set %tmp.partyline.chattr - $+ $flags($3)
- set %k.partyline.chattr $4
- if ($chkflag($gettok($1,2,46),$null,n) == $false) set %k.partyline.chattr $removecs(%k.partyline.chattr,n,r)
- if ((+ isin %k.partyline.chattr) || (- isin %k.partyline.chattr)) {
- set %i.partyline.chattr 0
- unset %j.partyline.chattr
- :start
- inc %i.partyline.chattr
- if ($mid(%k.partyline.chattr,%i.partyline.chattr,1) != $null) {
- if ($mid(%k.partyline.chattr,%i.partyline.chattr,1) == +) set %j.partyline.chattr +
- elseif ($mid(%k.partyline.chattr,%i.partyline.chattr,1) == -) set %j.partyline.chattr -
- else {
- if (%j.partyline.chattr == +) set %tmp.partyline.chattr - $+ $removecs(%tmp.partyline.chattr,$mid(%k.partyline.chattr,%i.partyline.chattr,1),-) $+ $mid(%k.partyline.chattr,%i.partyline.chattr,1)
- elseif (%j.partyline.chattr == -) set %tmp.partyline.chattr - $+ $removecs(%tmp.partyline.chattr,$mid(%k.partyline.chattr,%i.partyline.chattr,1),-)
- }
- goto start
- }
- }
- else set %tmp.partyline.chattr - $+ %k.partyline.chattr
- if ($5) {
- if ($remove(%tmp.partyline.chattr,-) != $null) {
- pl.checkflags $3 $cflags($3,$5) $remove(%tmp.partyline.chattr,-)
- writeini -n users.ini $3 $5 $remove(%tmp.partyline.chattr,-)
- pl.chkowner
- colupdt2 $3
- sockwrite -n $1 Flags for $3 are now + $+ $cflags($3,$5) $5
- return 1
- }
- pl.checkflags $3 $cflags($3,$5) -
- writeini -n users.ini $3 $5 -
- pl.chkowner
- colupdt2 $3
- sockwrite -n $1 Flags for $3 are now $cflags($3,$5) $5
- return 1
- }
- if (%k.partyline.chattr) {
- if ($remove(%tmp.partyline.chattr,-) != $null) {
- pl.checkflags $3 $flags($3) $remove(%tmp.partyline.chattr,-)
- writeini -n users.ini $3 flags $remove(%tmp.partyline.chattr,-)
- pl.chkowner
- colupdt2 $3
- sockwrite -n $1 Flags for $3 are now + $+ $flags($3)
- return 1
- }
- pl.checkflags $3 $flags($3) -
- writeini -n users.ini $3 flags -
- pl.chkowner
- colupdt2 $3
- sockwrite -n $1 Flags for $3 are now $flags($3)
- return 1
- }
- if ($flags($1) != -) sockwrite -n $1 Flags for $3 are + $+ $flags($1)
- else sockwrite -n $1 Flags for $3 are -
- return 1
- }
- partyline.+chrec {
- if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
- if ($4 == $null) {
- sockwrite -n $1 Usage: $2 <username> <#channel>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user!
- return 0
- }
- if ($findtok($usrchans($3),$4,1,44)) {
- sockwrite -n $1 Channel record already exists!
- return 0
- }
- writeini -n users.ini $3 channels $addtok($usrchans($3),$4,44)
- writeini -n users.ini $3 $4 -
- sockwrite -n $1 Added channel record for $3 in $4 $+ .
- return 1
- }
- partyline.-chrec {
- if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
- if ($4 == $null) {
- sockwrite -n $1 Usage: $2 <username> <#channel>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user!
- return 0
- }
- if ($findtok($usrchans($3),$4,1,44)) {
- if ($usrchans($3) == $4) remini users.ini $3 channels
- else writeini -n users.ini $3 channels $remtok($usrchans($3),$4,1,44)
- remini users.ini $3 $4
- remini users.ini $3 infoline. [ $+ [ $4 ] ]
- sockwrite -n $1 Removed channel record for $3 in $4 $+ .
- return 1
- }
- sockwrite -n $1 No such channel record!
- return 0
- }
- partyline.+user {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [hostmask]
- return 0
- }
- if ($usrhost($3)) {
- sockwrite -n $1 Someone already exists by that name.
- return 0
- }
- if ($4) set %adduser.addr $4
- elseif ($address($3,3)) set %adduser.addr $address($3,3)
- else {
- sockwrite -n $1 No hostmask supplied and user is not online!
- return 0
- }
- .auser 40 %adduser.addr
- .save -ru users.mrc
- writeini -n users.ini Users %adduser.addr $3
- writeini -n users.ini $3 hostmask %adduser.addr
- colupdt3 %adduser.addr
- sockwrite -n $1 Added $3 ( $+ %adduser.addr $+ ) with no password or flags.
- return 1
- }
- partyline.+bot {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [hostmask]
- return 0
- }
- if ($usrhost($3)) {
- sockwrite -n $1 Someone already exists by that name.
- return 0
- }
- if ($4) set %adduser.addr $4
- elseif ($address($3,1)) set %adduser.addr $address($3,1)
- else {
- sockwrite -n $1 No hostmask supplied and user is not online!
- return 0
- }
- .auser 40 %adduser.addr
- .save -ru users.mrc
- writeini -n users.ini Users %adduser.addr $3
- writeini -n users.ini $3 hostmask %adduser.addr
- writeini -n users.ini $3 flags b
- colupdt3 %adduser.addr
- sockwrite -n $1 Added bot ' $+ $3 $+ ' with no password.
- return 1
- }
- partyline.-user {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 Failed.
- return 0
- }
- if ($findtok(%owner,$3,1,44)) {
- sockwrite -n $1 Can't remove the owner!
- return 0
- }
- set %i 0
- :start
- inc %i
- if ($hstmask($3,%i)) {
- .ruser 40 $hstmask($3,%i)
- .timer -m 1 $mpy(%i,100) colupdt3 $hstmask($3,%i)
- remini users.ini Users $hstmask($3,%i)
- goto start
- }
- remini users.ini $3
- sockwrite -n $1 Deleted $3 $+ .
- return 1
- }
- partyline.-bot {
- partyline.-user $1-
- return $result
- }
- partyline.chpass {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [password]
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
- sockwrite -n $1 Can't change the owner's password.
- return 0
- }
- if ($4) {
- if ($len($4) <= 3) {
- sockwrite -n $1 Please use at least 4 characters.
- return 0
- }
- crypt 0 $lower($3) $4
- writeini -n users.ini $3 password $result
- sockwrite -n $1 Changed password.
- return 3
- }
- remini users.ini $3 password
- sockwrite -n $1 Removed password.
- return 1
- }
- partyline.chbotpass {
- if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [password]
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if ($4) {
- crypt 0 $lower($3) $4
- writeini -n users.ini $3 botpass $result
- sockwrite -n $1 Changed bot password.
- return 3
- }
- remini users.ini $3 botpass
- sockwrite -n $1 Removed bot password.
- return 1
- }
- partyline.chinfo {
- if (($chkflag($gettok($1,2,46),*,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username> [channel] <new-info>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
- sockwrite -n $1 Can't change info for the owner.
- return 0
- }
- if ($findtok($usrchans($3),$4,1,44)) {
- if ($5) {
- writeini -n users.ini $3 infoline. [ $+ [ $4 ] ] $strip($5-)
- sockwrite -n $1 New info for $3 on $4 $+ : $strip($5-)
- return 4
- }
- remini users.ini $3 infoline. [ $+ [ $4 ] ]
- sockwrite -n $1 Wiped info for $3 on $4
- return 1
- }
- if ($4) {
- writeini -n users.ini $3 infoline $strip($4-)
- sockwrite -n $1 New default info for $3 $+ : $strip($4-)
- return 3
- }
- remini users.ini $3 infoline
- sockwrite -n $1 Wiped default info for $3
- return 1
- }
- partyline.jump {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- sockwrite -n $1 Jumping servers...
- if ($server) quit changing servers
- server $3
- return 1
- }
- partyline.save {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- pl.fbc m *** Writing user file...
- .save -ru users.mrc
- pl.fbc m *** Writing variables...
- .save -rv vars.mrc
- return 1
- }
- partyline.+chan {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <#channel>
- return 0
- }
- if ($findtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,1,44)) {
- if ($me !ison $3) {
- join $2
- return 1
- }
- sockwrite -n $1 That channel already exists!
- return 0
- }
- set %autojoin. [ $+ [ %irc.network ] ] $addtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,44)
- join $3
- return 1
- }
- partyline.-chan {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <#channel>
- return 0
- }
- if ($findtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,1,44)) {
- set %autojoin. [ $+ [ %irc.network ] ] $remtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,44)
- sockwrite -n $1 Channel $3 removed.
- part $3
- return 1
- }
- if ($me ison $3) {
- part $3
- return 1
- }
- sockwrite -n $1 That channel doesn't exist!
- return 0
- }
- partyline.dump {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <server stuff>
- return 0
- }
- if ($server) .quote $3-
- return 1
- }
- partyline.simul {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <nick> <text>
- return 0
- }
- if ($sock($addtok(partyline,$3,46))) {
- .timer 1 0 pl.parse $addtok(partyline,$3,46) $4-
- return 1
- }
- sockwrite -n $1 No such person on the party line.
- return 0
- }
- partyline.die {
- if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
- if ($3) sockwrite -n partyline.* *** ircN SHUTDOWN ( $+ $gettok($1,2,46) $+ : $3- $+ )
- else sockwrite -n partyline.* *** ircN SHUTDOWN (authorized by $gettok($1,2,46) $+ )
- pl.fbc m *** Writing user file...
- .save -ru users.mrc
- pl.fbc m *** Writing variables...
- .save -rv vars.mrc
- if ($3) exit -y $3-
- else exit -y $gettok($1,2,46)
- return 1
- }
- partyline.chat {
- if ($3 == on) {
- if ($pl.var($gettok($1,2,46),channel) == $null) {
- pl.set $gettok($1,2,46) channel 0
- sockwrite -n $1 Entering the party line...
- pl.bc $1 *** $gettok($1,2,46) joined the party line.
- return 1
- }
- sockwrite -n $1 You're already on the partyline!
- return 0
- }
- if ($3 == off) {
- if ($pl.var($gettok($1,2,46),channel) != $null) {
- sockwrite -n $1 Leaving chat mode...
- if ($pl.var($gettok($1,2,46),channel) == 0) pl.bc $1 *** $gettok($1,2,46) left the party line.
- else pl.bc $1 *** $gettok($1,2,46) has left the channel.
- pl.unset $gettok($1,2,46) channel $3
- return 1
- }
- sockwrite -n $1 You weren't in chat anyway!
- return 0
- }
- if (($3 == $null) || ($3 == 0)) {
- if ($pl.var($gettok($1,2,46),channel) != 0) {
- if ($pl.var($gettok($1,2,46),channel) != $null) pl.bc $1 *** $gettok($1,2,46) left the channel.
- pl.set $gettok($1,2,46) channel 0
- sockwrite -n $1 Entering the party line...
- pl.bc $1 *** $gettok($1,2,46) joined the party line.
- return 1
- }
- sockwrite -n $1 You're already on the party line!
- return 0
- }
- if ($3 isnum 1-99999) {
- if ($pl.var($gettok($1,2,46),channel) == $3) {
- sockwrite -n $1 You're already on channel $3 $+ !
- return 0
- }
- if ($pl.var($gettok($1,2,46),channel) == 0) pl.bc $1 *** $gettok($1,2,46) left the party line.
- else pl.bc $1 *** $gettok($1,2,46) left the channel.
- pl.set $gettok($1,2,46) channel $3
- sockwrite -n $1 Joining channel ' $+ $3 $+ '...
- pl.bc $1 *** $gettok($1,2,46) joined the channel.
- return 1
- }
- if ($3 isnum) {
- sockwrite -n $1 Channel number out of range: must be between 0 and 99999.
- return 0
- }
- if ($3) {
- sockwrite -n $1 No channel by that name.
- return 0
- }
- }
- partyline.away {
- if ($3 == $null) {
- if ($pl.var($gettok($1,2,46),away) == $null) {
- sockwrite -n $1 You weren't away!
- return 0
- }
- pl.unset $gettok($1,2,46) away
- sockwrite -n $1 You have returned.
- pl.bc $1 *** $gettok($1,2,46) is no longer away.
- return 1
- }
- pl.set $gettok($1,2,46) away $strip($3-)
- pl.bc $1 *** $gettok($1,2,46) is now away: $strip($3-)
- return 1
- }
- partyline.whom {
- if ($pl.var($gettok($1,2,46),channel) == $null) return -2
- if ($4 isnum 0-99999) set %tmp $4
- elseif ($4 isnum) {
- sockwrite -n $1 Channel number out of range: must be 0-99999
- return 0
- }
- elseif ($4) {
- sockwrite -n $1 No such channel.
- return 0
- }
- else set %tmp $pl.var($gettok($1,2,46),channel)
- sockwrite -n $1 $fix(12,Nick) $fix(10,Bot) Host
- sockwrite -n $1 $fix(12,----------) $fix(10,---------) ------------------------------
- set %i 0
- :loop
- inc %i
- set %dcnick $gettok($sock(partyline.*,%i),2,46)
- if (%dcnick) {
- if (($pl.var(%dcnick,channel) == %tmp) || (%tmp == *)) {
- sockwrite -n $1 $fix(12,$pl.whom(%dcnick)) $fix(10,$me) telnet: $+ $sock(partyline.*,%i).ip [idle $rsc($duration($sub($ctime,$pl.var(%dcnick,idle)))) $+ ]]
- if ($pl.var(%dcnick,away) != $null) sockwrite -n $1 $lfix(8,AWAY:) $pl.var(%dcnick,away)
- }
- goto loop
- }
- return 1
- }
- partyline.whois {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username>
- return 0
- }
- if ($usrhost($3) == $null) {
- sockwrite -n $1 Can't find anyone matching that.
- return 0
- }
- if ($readini users.ini $3 password != $null) set %uwhois.pass yes
- else set %uwhois.pass no
- if ($readini users.ini $3 botpass != $null) set %uwhois.bpass yes
- else set %uwhois.bpass no
- set %uwhois.notes N/A
- set %uwhois.seen $readini -n users.ini $3 seen
- :begin
- sockwrite -n $1 $fix(9,HANDLE) PASS BOTPASS NOTES $fix(17,FLAGS) LAST
- sockwrite -n $1 $fix(9,$3) $fix(4,%uwhois.pass) $fix(7,%uwhois.bpass) $fix(5,%uwhois.notes) $fix(17,$iif($flags($3),$flags($3),-)) $iif(%uwhois.seen,$asctime($gettok(%uwhois.seen,1,32),h:nntt),never)
- set %i 0
- :flags
- inc %i
- if ($gettok($usrchans($3),%i,44)) {
- sockwrite -n $1 $fix(26,$gettok($usrchans($3),%i,44)) $iif($cflags($3,$gettok($usrchans($3),%i,44)),$cflags($3,$gettok($usrchans($3),%i,44)),-)
- if ($infoline($3,$gettok($usrchans($3),%i,44))) sockwrite -n $1 #INFO: $infoline($3,$gettok($usrchans($3),%i,44))
- goto flags
- }
- set %i 0
- :hosts
- inc %i
- set %uwhois.host $hstmask($3,%i)
- if (%uwhois.host != $null) {
- sockwrite -n $1 $iif(%i == 1,$lfix(8,HOSTS:),$fix(8,)) %uwhois.host
- goto hosts
- }
- if ($infoline($3)) %uwhois.cmd $lfix(7,INFO:) $infoline($3)
- unset %uwhois.*
- return 1
- }
- partyline.me {
- if ($pl.var($gettok($1,2,46),channel) == $null) return -2
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <action>
- return 0
- }
- if ($pl.var($gettok($1,2,46),away)) partyline.away $1 .away
- pl.bc $1 * $gettok($1,2,46) $3-
- pl.set $gettok($1,2,46) idle $ctime
- return 0
- }
- partyline.say {
- if ($pl.var($gettok($1,2,46),channel) == $null) return -2
- if ($pl.var($gettok($1,2,46),away)) partyline.away $1 .away
- if ($3 == ACTION) pl.bc $1 * $gettok($1,2,46) $getleft($4-)
- else pl.bc $1 < $+ $gettok($1,2,46) $+ > $3-
- pl.set $gettok($1,2,46) idle $ctime
- return 0
- }
- partyline.echo {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <on/off>
- return 0
- }
- if ($3 == on) {
- pl.set $gettok($1,2,46) echo on
- sockwrite -n $1 Echo turned on.
- return 1
- }
- if ($3 == off) {
- pl.set $gettok($1,2,46) echo off
- sockwrite -n $1 Echo turned off.
- return 1
- }
- sockwrite -n $1 Echo is currently $pl.var($gettok($1,2,46),echo) $+ .
- return 0
- }
- partyline.help {
- if ($3 == $null) {
- sockwrite -n $1 DCC COMMANDS for $me $+ , %iver $+ :
- qplay -s $td(help.txt) chelp $readini $td(help.txt) chelp n sockwrite -n $1
- if ($chkflag($gettok($1,2,46),*,m)) qplay -s $td(help.txt) mhelp $readini $td(help.txt) mhelp n sockwrite -n $1
- if ($chkflag($gettok($1,2,46),*,n)) qplay -s $td(help.txt) nhelp $readini $td(help.txt) nhelp n sockwrite -n $1
- sockwrite -n $1 All commands begin with '.' and all else goes to the party line.
- if ($chkflag($gettok($1,2,46),*,m)) sockwrite -n $1 Text starting with ',' is sent ONLY to masters.
- sockwrite -n $1 You can get help on individual commands: '.help <command>'
- return 1
- }
- if ($readini $td(help.txt) $3 n != $null) {
- qplay -s $td(help.txt) $3 $readini $td(help.txt) $3 n sockwrite -n $1
- return 1
- }
- sockwrite -n $1 No help available on that.
- return 0
- }
- partyline.timestamp {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <on/off>
- return 0
- }
- if ($3 == on) {
- pl.set $gettok($1,2,46) timestamp on
- sockwrite -n $1 Timestamp turned on.
- return 1
- }
- if ($3 == off) {
- pl.set $gettok($1,2,46) timestamp off
- sockwrite -n $1 Timestamp turned off.
- return 1
- }
- sockwrite -n $1 Timestamp is currently $pl.var($gettok($1,2,46),timestamp) $+ .
- return 0
- }
- partyline.quit {
- pl.bc $1 *** $gettok($1,2,46) left the party line $+ $iif($3,:,.) $3-
- sockwrite -n $1 *** Ja mata!
- pl.clr $gettok($1,2,46)
- if ($sock($puttok($1,telnet,1,46))) {
- sockclose $1
- return 1
- }
- sockwrite -n $1 Returning to interface menu...
- sockrename $1 $puttok($1,telnet,1,46)
- tel.login $puttok($1,telnet,1,46) .
- return 1
- }
- partyline.notes sockwrite -n $1 Command not implemented. | return 0
- partyline.note sockwrite -n $1 Command not implemented. | return 0
- partyline.files sockwrite -n $1 There is no file transfer area. | return 0
- partyline.newpass {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <newpassword>
- return 0
- }
- if ($3) {
- if ($len($3) <= 3) {
- sockwrite -n $1 Please use at least 4 characters.
- return 0
- }
- crypt 0 $lower($gettok($1,2,46)) $3
- writeini -n users.ini $gettok($1,2,46) password $result
- sockwrite -n $1 Changed password to ' $+ $3 $+ '
- return 2
- }
- }
- partyline.motd {
- qplay -f $td(cmotd.txt) sockwrite -n $1
- return 1
- }
- partyline.info {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 [channel] <info line/none>
- return 0
- }
- if ($findtok($usrchans($gettok($1,2,46)),$3,1,44)) {
- if ($4 == none) {
- remini users.ini $gettok($1,2,46) infoline. [ $+ [ $3 ] ]
- sockwrite -n $1 Removed your info line on $3 $+ .
- return 1
- }
- if ($4) {
- writeini -n users.ini $gettok($1,2,46) infoline. [ $+ [ $3 ] ] $4-
- sockwrite -n $1 Info on $3 $+ : $4-
- sockwrite -n $1 Use '.info $3 none' to remove it/
- return 3
- }
- }
- if ($3 == none) {
- remini users.ini $gettok($1,2,46) infoline
- sockwrite -n $1 Removed your default info line.
- return 1
- }
- writeini -n users.ini $gettok($1,2,46) infoline $3-
- sockwrite -n $1 Default info: $3-
- sockwrite -n $1 Use '.info none' to remove it/
- return 2
- }
- partyline.su {
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <username>
- return 0
- }
- if ($hstmask($3) == $null) {
- sockwrite -n $1 No such user.
- return 0
- }
- if ($sock($addtok(partyline,$3,46))) {
- sockwrite -n $1 User is already in the partyline. You may not .su to them
- return 0
- }
- if ($sock($addtok($addtok(su,$3,46),*,46))) {
- sockwrite -n $1 Someone is already attempting to .su to that user. You may not .su to them
- return 0
- }
- if ($password($3) == $null) {
- sockwrite -n $1 No password set for user. You may not .su to them
- return 0
- }
- partyline.chat $1 .chat off
- pl.clr $gettok($1,2,46)
- if (($chkflag($gettok($1,2,46),*,n)) && ($chkflag($3,*,n) == $false)) {
- sockrename $1 $addtok(partyline,$3,46)
- pl.login $addtok(partyline,$3,46)
- return 1
- }
- sockwrite -n $1 $crlf $+ Enter your password.
- sockrename $1 $addtok($addtok(su,$3,46),$gettok($1,2,46),46)
- return 1
- }
- partyline.+ban {
- if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
- if (%userbans == off) {
- sockwrite -n $1 Access denied.
- return 0
- }
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <hostmask> [channel] [reason]
- return 0
- }
- if ($ulist($3,20,0)) {
- sockwrite -n $1 A matching ban already exists!
- return 0
- }
- if ($me ison $4) set %banchans $4
- else set %banchans all
- if ($5) {
- if ($me ison $4) set %reason $gettok($1,2,46) $+ : $5-
- else set %reason $gettok($1,2,46) $+ : $4-
- }
- else set %reason $gettok($1,2,46) $+ : request
- if ($chkflag($gettok($1,2,46),$iif(%banchans == all,$null,%banchans),o) == $false) {
- if (%banchans == all) sockwrite -n $1 Can't place global ban
- else sockwrite -n $1 Can't place ban in %banchans
- return 0
- }
- writeini -n bans.ini $3 reason %reason
- writeini -n bans.ini $3 channels %banchans
- .auser 20 $3
- .save -ru users.mrc
- colupdt3 $3
- sockwrite -n $1 New $iif(%banchans == all,global,%banchans) ban: $3 $paren(%reason)
- if (%banchans == all) set %banchans $mychans
- unset %tmp
- set %i 0
- :start
- inc %i
- if ($gettok(%banchans,%i,44)) {
- if ($me isop $gettok(%banchans,%i,44)) set %tmp %tmp $+ $crlf $+ mode $gettok(%banchans,%i,44) b $3
- goto start
- }
- if (%tmp) .quote %tmp
- unset %reason %banchans %tmp
- return 1
- }
- partyline.-ban {
- if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
- if (%userbans == off) {
- sockwrite -n $1 Access denied.
- return 0
- }
- if ($3 == $null) {
- sockwrite -n $1 Usage: $2 <hostmask/ban #>
- return 0
- }
- if ($3 isnum) set %tmp2 $ulist(*,20,$3)
- else set %tmp2 $ulist($3,20,1)
- if ($chkflag($gettok($1,2,46),$usrchans($ulist(*,20,$3)),o) == $false) {
- sockwrite -n $1 Can't remove ban.
- return 0
- }
- if (%tmp2) {
- set %banchans $usrchans(%tmp2)
- remini bans.ini %tmp2
- .timer 1 0 colupdt3 %tmp2
- .ruser 20 %tmp2
- .save -ru users.mrc
- sockwrite -n $1 Removed ban: %tmp2
- if (%banchans == all) set %banchans $mychans
- unset %tmp
- set %i 0
- :start
- inc %i
- if ($gettok(%banchans,%i,44)) {
- if ($me isop $gettok(%banchans,%i,44)) set %tmp %tmp $+ $crlf $+ mode $gettok(%banchans,%i,44) -b %tmp2
- goto start
- }
- if (%tmp) .quote %tmp
- return 1
- }
- sockwrite -n $1 No such ban: $1
- return 0
- }
- partyline.bans {
- if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
- if (%userbans == off) {
- sockwrite -n $1 Access denied.
- return 0
- }
- if ($ulist(*,20,0)) sockwrite -n $1 Recorded bans:
- else sockwrite -n $1 No bans recorded.
- set %i 0
- :start
- inc %i
- if ($ulist(*,20,%i)) {
- sockwrite -n $1 $lfix(3,[) $+ $lfix(3,%i) $+ ] $ulist(*,20,%i) (perm)
- sockwrite -n $1 $fix(5,) $readini bans.ini $ulist(*,20,%i) reason
- sockwrite -n $1 $fix(5,) Channels: $readini bans.ini $ulist(*,20,%i) channels
- goto start
- }
- return 1
- }
- partyline.remote {
- if (%icontrol == off) {
- sockwrite -n $1 Remote control is disabled.
- return 0
- }
- if ($chkflag($gettok($1,2,46),$null,r) == $false) {
- sockwrite -n $1 Access denied.
- return 0
- }
- if ($sock($puttok($1,remote,1,46))) {
- sockwrite -n $1 You are already in the remote control interface!
- return 0
- }
- partyline.chat $1 .chat off
- sockrename $1 $puttok($1,remote,1,46)
- rc.login $puttok($1,remote,1,46)
- }
-